<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>营销监控</title>
    <link rel="stylesheet" href="${contextPath}/static/statistics/css/bootstrap.min.css">
    <!-- <link rel="stylesheet" href="https://unpkg.com/iview@2.12.0/dist/styles/iview.css"> -->

    <script src="${contextPath}/static/statistics/js/jquery.js"></script>
    <script src="${contextPath}/static/statistics/js/bootstrap.min.js"></script>
    <script src=${contextPath}/static/layer/layer.js></script>
    <script src="${contextPath}/static/statistics/js/echarts.min.js"></script>

    <script type="text/javascript" src="http://vuejs.org/js/vue.min.js"></script>
    <script type="text/javascript" src="https://unpkg.com/iview@2.12.0/dist/iview.min.js"></script>

    <style type="text/css">
        body {
            background-color: #0c2a52;
        }
        .zc-container {
            text-align: center;
        }
        .zc-title {

        }
        .col-left {
            text-align: left;
        }
        .col-center {
            text-align: center;
        }

        .zc-zb-box {
            overflow: hidden;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -ms-flex-wrap: wrap;
            flex-wrap: wrap;
            -webkit-box-align: baseline;
            -ms-flex-align: baseline;
            align-items: baseline;
            padding: 20px;
        }
        .zc-zb-name {
            font-size: 15px;
            color: #dcdcdc;
            line-height: 16px;
        }
        .zc-zb-num {
            font-size: 37px;
            color: #fff;
            line-height: 48px;
            margin-left: 20px;
        }
        .zc-zb-pc {
            font-size: 25px;
            color: green;
            line-height: 35px;
            margin-left: 15px;
        }
        .zc-zb-change {
            margin-left: 10px;
        }
        .zc-map {
        }
        .right-zb-box{

        }
        tr th {
            text-align: center;
            color: #00c9ff;
            font-size: 17px;
        }
        tr td {
            font-size: 15px;
        }
        .table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
            border-bottom-width: 1px;
        }


        @media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
            .masked{
                background-image: -webkit-linear-gradient(left, #147B96, #E6D205 25%, #147B96 50%, #E6D205 75%, #147B96);
                -webkit-text-fill-color: transparent;
                -webkit-background-clip: text;
                -webkit-background-size: 200% 100%;
                -webkit-animation: masked-animation 4s infinite linear;
            }
        }
        @-webkit-keyframes masked-animation {
            0%  { background-position: 0 0;}
            100% { background-position: -100% 0;}
        }
        .zb-box {
            position: relative;
            height: 140px;
            width: 260px;
            left: 50%;
            transform: translate(-50%,0%);
        }
        .zb-jj {
            width: 0px;
            height: 0px;
            border-top: 30px solid transparent;
            border-right: 30px solid transparent;
            border-bottom: 30px solid transparent;
            border-left: 18px solid #2769c1;
            position: absolute;
            top: 20px;
            left: 240px;
        }
        .zb-nr {
            position: absolute;
            top:20px;
            left: 0px;
            width: 240px;
            height: 60px;
            background-color: #2769c1;
            padding-left: 100px;
            text-align: left;
        }
        .zb-title {
            margin-top: 5px;
            color: #fff;
        }
        .zb-num {
            color: red;
            font-size: 26px;
        }
        .zb-image-b {
            width: 80px;
            height: 60px;
            position: absolute;
            top: 0px;
            left: 0px;
            background-color: #0d1365;
        }
        .zb-image {
            width: 36px;
            height: 36px;
            margin-top: 12px;
        }
    </style>
</head>
<body>
<div class="container-fluid zc-container">
    <div class="row">
        <div class="col-sm-12 zc-title">
            <h1 style="color: #e2e2e2;">营销监控<small>客户订单数据</small></h1>
        </div>
    </div>
    <hr style="border-top: 1px solid #ccc;">
    <div class="row">
        <div class="col-sm-3 con-left" id="app">
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        客户总数
                    </div>
                    <div class="zb-num" style="color:#db444e;">
                        {{numData.customer}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a1.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        标杆终端
                    </div>
                    <div class="zb-num" style="color:#97d209;">
                        {{numData.biaoGan}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a2.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        现代终端
                    </div>
                    <div class="zb-num" style="color:#26f3e6;">
                        {{numData.xianDai}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a3.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        信息采集点
                    </div>
                    <div class="zb-num" style="color:#db444e;">
                        {{numData.xinXi}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a4.png" class="zb-image"/>
                </div>
            </div>
            <div class="zb-box">
                <div class="zb-nr">
                    <div class="zb-title">
                        事件营销点
                    </div>
                    <div class="zb-num" style="color:#a6a737;">
                        {{numData.shiJian}}
                    </div>
                </div>
                <div class="zb-jj"></div>
                <div class="zb-image-b">
                    <img src="${contextPath}/static/image/daping/pageIcon/a5.png" class="zb-image"/>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-center">
            <div class="zc-map" id="zc-map"></div>
        </div>
        <div class="col-sm-3">
            <div class="table-responsive">
                <h4 style="color: #fff9ec">当日订单情况</h4>
                <table class="table table-bordered" style="color: #a5eaa9;">
                    <thead>
                    </thead>
                    <tbody>
                        <tr>
                            <th>笔数</th>
                            <td id="strokeCount"></td>
                        </tr>
                        <tr>
                            <th>数量</th>
                            <td id="number">67898</td>
                        </tr>
                        <tr>
                            <th>金额</th>
                            <td id="money">2889434.98</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="table-responsive">
                <h4 style="color: #fff9ec">同比销量库存</h4>
                <table class="table table-bordered" style="color: #a5eaa9;">
                    <thead>
                    <tr>
                        <th></th>
                        <th>2017</th>
                        <th>2018</th>
                        <th>差量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <th>销量</th>
                        <td id="beforeSales">780</td>
                        <td id="presentSales">590</td>
                        <td id="differenceSales">19</td>
                    </tr>
                    <tr>
                        <th>库存</th>
                        <td id="beforeRepertory">789</td>
                        <td id="presentRepertory">567</td>
                        <td id="differenceRepertory">222</td>
                    </tr>
                    </tbody>
                </table>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=ec3688cc2547017ad39dd55153d18b85"></script>
<script>

    // 高度设置
    $('#zc-map').height($('#zc-map').width()*1);
    {
        var total = $(document).height();
        $('.table-responsive').height(total*0.4);
    }


    //初始化地图
    var map = new AMap.Map('zc-map',{
        resizeEnable: true,
        zoom: 12,
        mapStyle: 'amap://styles/grey',
        center: [116.39,39.9]//new AMap.LngLat(116.39,39.9)
    });
    AMap.plugin(['AMap.ToolBar', 'AMap.Scale', 'AMap.MapType'], function() {
        toolBar = new AMap.ToolBar();  //工具条
        scale = new AMap.Scale();    //比例尺
        map.addControl(toolBar);
        map.addControl(scale);
    });
    var infoWindow = new AMap.InfoWindow();

    //初始化统计图
    //var myChart =  echarts.init($("#main")[0]);

    //vue实例
    new Vue({
        el: '#app',
        data: {
            markerList : [],
            numData:{
                customer: 0,
                biaoGan : 0,
                xianDai: 0,
                xinXi: 0,
                shiJian: 0,
            }
        },
        mounted: function () {
            this.getData();
        },
        methods: {
            getData: function () {

                var vm = this;
                $.ajax({
                    url: '${contextPath}/shop/getLogisticsData',
                    type: 'post',
                    dataType: 'json',
                    data: {
                        stringMap: {

                        }
                    },
                    //{success:true,data:{customer:'212',biaoGan:'222',xianDai:'2121',xinXi:'21',shiJian:'22',customerLocations:[]}}
                    success: function (data) {
                        if (data.success) {


                            var customerLocation = data.data.customerLocations;

                            vm.updateNumData(data.data);

                            vm.updateMap(customerLocation);


                        } else {
                            layer.msg(data.message)
                        }
                    },
                    error: function (error) {
                        layer.msg("网络错误")
                    }
                })
            },
            updateNumData : function (data) {


                data = {
                    customer:530,
                    biaoGan : 302,
                    xianDai: 232,
                    xinXi: 53,
                    shiJian: 5650,
                    strokeCount: 2350,
                    number: 20190,
                    money: 120832.93,

                    beforeSales: 780,
                    presentSales: 832,
//                    differenceSales: ,   //

                    beforeRepertory: 789,
                    presentRepertory: 2222,
//                    differenceRepertory:
                };

                this.numData.customer = data.customer ?  data.customer: '0';
                this.numData.biaoGan = data.biaoGan ?  data.biaoGan: '0';
                this.numData.xianDai = data.xianDai ?  data.xianDai: '0';
                this.numData.xinXi = data.xinXi ?  data.xinXi: '0';
                this.numData.shiJian = data.shiJian ?  data.shiJian: '0';



                $('#strokeCount').html(data.strokeCount ? data.strokeCount: '0');
                $('#number').html(data.number ? data.number: '0');
                $('#money').html(data.money ? data.money: '0');

                $('#beforeSales').html(data.beforeSales ? data.beforeSales: '0');
                $('#beforeSales').html(data.beforeSales ? data.beforeSales: '0');
                $('#differenceSales').html(Math.abs(data.beforeSales - data.presentSales));

                $('#beforeRepertory').html(data.beforeRepertory ? data.beforeRepertory: '0');
                $('#presentRepertory').html(data.presentRepertory ? data.presentRepertory: '0');
                $('#differenceRepertory').html(Math.abs(data.beforeRepertory - data.presentRepertory));



            },
            updateMap : function (dataArray) {

                dataArray = [
                    {CUST_CODE:"520201105930",CUST_NAME:"明旺食品经营部",SHORT_NAME:"钟山",SHOP_NAME:"明旺食品经营部",SHOP_ID:"10972",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.57318",LONGITUDE:"104.88262",IS_EXP:"1"},
                    {CUST_CODE:"520201105938",CUST_NAME:"钟山区黔兰食品经营部",SHORT_NAME:"钟山",SHOP_NAME:"钟山区黔兰食品经营部",SHOP_ID:"13165",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.57335",LONGITUDE:"104.88202",IS_EXP:"1"},
                    {CUST_CODE:"520201106803",CUST_NAME:"钟山区祥瑞烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"钟山区祥瑞烟酒店",SHOP_ID:"11436",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.56225",LONGITUDE:"104.90809",IS_EXP:"1"},
                    {CUST_CODE:"520201103571",CUST_NAME:"连兴平价店",SHORT_NAME:"钟山",SHOP_NAME:"连兴平价店",SHOP_ID:"17318",ADDRESS:"贵州省六盘水市钟山区幸福路191号楼附近",LATITUDE:"26.5803",LONGITUDE:"104.89989",IS_EXP:"1"},
                    {CUST_CODE:"520201101538",CUST_NAME:"吴远伦",SHORT_NAME:"钟山",SHOP_NAME:"吴远伦",SHOP_ID:"17428",ADDRESS:"贵州省六盘水市钟山区红岩路与麒麟路交叉口西北100米",LATITUDE:"26.61788",LONGITUDE:"106.64454",IS_EXP:"0"},
                    {CUST_CODE:"520201106401",CUST_NAME:"洪英百货",SHORT_NAME:"钟山",SHOP_NAME:"洪英百货",SHOP_ID:"17563",ADDRESS:"贵州省六盘水市钟山区凤凰东路1号附14号",LATITUDE:"26.61788",LONGITUDE:"106.6445",IS_EXP:"0"},
                    {CUST_CODE:"520201101665",CUST_NAME:"平俊便利店",SHORT_NAME:"钟山",SHOP_NAME:"平价超市",SHOP_ID:"15245",ADDRESS:"贵州省六盘水市钟山区人民东路与金水南路交叉口东200米",LATITUDE:"26.56108",LONGITUDE:"104.91973",IS_EXP:"1"},
                    {CUST_CODE:"520201107118",CUST_NAME:"馨怡副食店",SHORT_NAME:"钟山",SHOP_NAME:"贵州省六盘水市钟山区教场贵仁路288号",SHOP_ID:"17489",ADDRESS:"贵州省六盘水市钟山区麒麟路11号附80号(布雷尔利旗舰店)",LATITUDE:"26.58439",LONGITUDE:"104.86151",IS_EXP:"0"},
                    {CUST_CODE:"520201101465",CUST_NAME:"林菊",SHORT_NAME:"钟山",SHOP_NAME:"麦架镇王二便利店",SHOP_ID:"3764",ADDRESS:"贵州省贵阳市白云区麦架镇金鱼桥水库",LATITUDE:"26.71217",LONGITUDE:"106.62284",IS_EXP:"2"},
                    {CUST_CODE:"520201101413",CUST_NAME:"黄顺先",SHORT_NAME:"钟山",SHOP_NAME:"黄顺先",SHOP_ID:"17150",ADDRESS:"贵州省六盘水市钟山区杨柳街道巴西警察署七号点社区警务室",LATITUDE:"26.59209",LONGITUDE:"104.8922",IS_EXP:"1"},
                    {CUST_CODE:"520201103346",CUST_NAME:"赵德芬",SHORT_NAME:"钟山",SHOP_NAME:"赵德芬",SHOP_ID:"17298",ADDRESS:"贵州省六盘水市钟山区大湾镇三叉路",LATITUDE:"26.77718",LONGITUDE:"104.61927",IS_EXP:"1"},
                    {CUST_CODE:"520201106252",CUST_NAME:"华联万家超市",SHORT_NAME:"钟山",SHOP_NAME:"华联万家超市",SHOP_ID:"17280",ADDRESS:"贵州省六盘水市水城县红桥大道与纸红公路交叉口西南150米",LATITUDE:"26.53705",LONGITUDE:"104.90363",IS_EXP:"1"},
                    {CUST_CODE:"520201106397",CUST_NAME:"利邻便利店",SHORT_NAME:"钟山",SHOP_NAME:"利邻便利店",SHOP_ID:"6453",ADDRESS:"贵州省六盘水市钟山区大连路西100米",LATITUDE:"26.56191",LONGITUDE:"104.84193",IS_EXP:"1"},
                    {CUST_CODE:"520201106648",CUST_NAME:"双益烟酒副食超市",SHORT_NAME:"钟山",SHOP_NAME:"双益烟酒副食超市",SHOP_ID:"7347",ADDRESS:"贵州省六盘水市钟山区凤凰街道货车绕城环线",LATITUDE:"26.54513",LONGITUDE:"104.87675",IS_EXP:"1"},
                    {CUST_CODE:"520201105833",CUST_NAME:"家惠超市",SHORT_NAME:"钟山",SHOP_NAME:"优乐购生活超市",SHOP_ID:"12353",ADDRESS:"贵州省六盘水市钟山区康乐南路5号附近",LATITUDE:"26.59551",LONGITUDE:"104.82549",IS_EXP:"1"},
                    {CUST_CODE:"520201104757",CUST_NAME:"惠彦便利店",SHORT_NAME:"钟山",SHOP_NAME:"惠彦便利店",SHOP_ID:"11718",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.56728",LONGITUDE:"104.88375",IS_EXP:"1"},
                    {CUST_CODE:"520201106217",CUST_NAME:"大众烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"大众烟酒店",SHOP_ID:"9320",ADDRESS:"北京市东城区东华门街道缎库胡同52号缎库胡同15号院",LATITUDE:"39.91125",LONGITUDE:"116.40589",IS_EXP:"1"},
                    {CUST_CODE:"520201100513",CUST_NAME:"宏达烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"薛朝庆",SHOP_ID:"16491",ADDRESS:"贵州省六盘水市钟山区钟山大道与麒麟路交汇处西北侧新世纪大厦一栋一楼118室",LATITUDE:"26.58227",LONGITUDE:"104.86136",IS_EXP:"1"},
                    {CUST_CODE:"520201100194",CUST_NAME:"香生博雅烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"香生博雅烟酒店 ",SHOP_ID:"17181",ADDRESS:"贵州省六盘水市钟山区富民路与迎新街交叉口北100米",LATITUDE:"26.58518",LONGITUDE:"104.86",IS_EXP:"1"},
                    {CUST_CODE:"520201100696",CUST_NAME:"陈学珠",SHORT_NAME:"钟山",SHOP_NAME:"陈学珠",SHOP_ID:"14111",ADDRESS:"明湖路3号(近水城四小)",LATITUDE:"26.59124",LONGITUDE:"104.83768",IS_EXP:"1"},
                    {CUST_CODE:"520201106259",CUST_NAME:"李金芬",SHORT_NAME:"钟山",SHOP_NAME:"金芬烟酒蔬菜水果店",SHOP_ID:"9808",ADDRESS:"贵州省六盘水市钟山区凤凰街道中共六盘水市委党校",LATITUDE:"26.58449",LONGITUDE:"104.80588",IS_EXP:"0"},
                    {CUST_CODE:"520201105556",CUST_NAME:"张高芬",SHORT_NAME:"钟山",SHOP_NAME:"张高芬",SHOP_ID:"10223",ADDRESS:"贵州省六盘水市钟山区人民中路与区府东路交叉口东北50米",LATITUDE:"26.5894",LONGITUDE:"104.84583",IS_EXP:"1"},
                    {CUST_CODE:"520201100232",CUST_NAME:"万和糖烟酒超市",SHORT_NAME:"钟山",SHOP_NAME:"万和糖烟酒超市",SHOP_ID:"7518",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58525",LONGITUDE:"104.84335",IS_EXP:"1"},
                    {CUST_CODE:"520201105757",CUST_NAME:"钟山区金宏达烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"钟山区金宏达烟酒店",SHOP_ID:"7063",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58405",LONGITUDE:"104.84704",IS_EXP:"1"},
                    {CUST_CODE:"520201100213",CUST_NAME:"柯余均",SHORT_NAME:"钟山",SHOP_NAME:"柯余均",SHOP_ID:"11060",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58512",LONGITUDE:"104.84573",IS_EXP:"1"},
                    {CUST_CODE:"520201105755",CUST_NAME:"钟山开发区博利烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"刘世龙",SHOP_ID:"14417",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58536",LONGITUDE:"104.84326",IS_EXP:"1"},
                    {CUST_CODE:"520201103908",CUST_NAME:"百江付食自选店",SHORT_NAME:"钟山",SHOP_NAME:"邓军",SHOP_ID:"16558",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58004",LONGITUDE:"104.84725",IS_EXP:"1"},
                    {CUST_CODE:"520201106152",CUST_NAME:"钟山开发区简用仙洗烫店",SHORT_NAME:"钟山",SHOP_NAME:"钟山开发区简用仙洗烫店",SHOP_ID:"14929",ADDRESS:"贵州省六盘水市钟山区人民中路77号附近",LATITUDE:"26.58674",LONGITUDE:"104.84907",IS_EXP:"1"},
                    {CUST_CODE:"520201100408",CUST_NAME:"刘桂云",SHORT_NAME:"钟山",SHOP_NAME:"刘桂云",SHOP_ID:"16255",ADDRESS:"贵州省六盘水市钟山区荷泉街道交通北路72号",LATITUDE:"26.58668",LONGITUDE:"104.84648",IS_EXP:"1"},
                    {CUST_CODE:"520201101944",CUST_NAME:"彭光华",SHORT_NAME:"钟山",SHOP_NAME:"彭光华",SHOP_ID:"16548",ADDRESS:"贵州省六盘水市钟山区南环路人民广场青少年活动中心对面",LATITUDE:"26.57996",LONGITUDE:"104.85202",IS_EXP:"0"},
                    {CUST_CODE:"520201101931",CUST_NAME:"龙正山",SHORT_NAME:"钟山",SHOP_NAME:"龙正山",SHOP_ID:"15395",ADDRESS:"贵州省六盘水市钟山区开发区龙井路爱心园儿童城3楼",LATITUDE:"26.58046",LONGITUDE:"104.84655",IS_EXP:"1"},
                    {CUST_CODE:"520201104891",CUST_NAME:"刘远会",SHORT_NAME:"钟山",SHOP_NAME:"刘远会",SHOP_ID:"13245",ADDRESS:"贵州省六盘水市钟山区黄土坡街道钟山大道江源大厦9楼",LATITUDE:"26.58376",LONGITUDE:"104.84785",IS_EXP:"1"},
                    {CUST_CODE:"520201104510",CUST_NAME:"谢红梅",SHORT_NAME:"钟山",SHOP_NAME:"谢红梅",SHOP_ID:"7524",ADDRESS:"贵州省六盘水市钟山区凤凰街道钟山大道62号",LATITUDE:"26.585",LONGITUDE:"104.84612",IS_EXP:"1"},
                    {CUST_CODE:"520201100319",CUST_NAME:"海月烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"海月烟酒店",SHOP_ID:"17190",ADDRESS:"贵州省六盘水市钟山区麒麟路11号附80号(布雷尔利旗舰店)",LATITUDE:"26.58449",LONGITUDE:"104.8613",IS_EXP:"1"},
                    {CUST_CODE:"520201107027",CUST_NAME:"齐心家家乐超市",SHORT_NAME:"钟山",SHOP_NAME:"鑫家乐商贸有限公司",SHOP_ID:"17265",ADDRESS:"麒麟路闽南家居对面",LATITUDE:"26.58341",LONGITUDE:"104.86242",IS_EXP:"1"},
                    {CUST_CODE:"520201100296",CUST_NAME:"蔡明山",SHORT_NAME:"钟山",SHOP_NAME:"蔡明山",SHOP_ID:"17451",ADDRESS:"贵州省六盘水市钟山区凉都大道与龙井路交叉口东150米",LATITUDE:"26.61787",LONGITUDE:"106.64451",IS_EXP:"1"},
                    {CUST_CODE:"520201102126",CUST_NAME:"谢成秀",SHORT_NAME:"钟山",SHOP_NAME:"谢成秀",SHOP_ID:"12626",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.58164",LONGITUDE:"104.86259",IS_EXP:"1"},
                    {CUST_CODE:"520201105993",CUST_NAME:"钟山区永和烟酒店",SHORT_NAME:"钟山",SHOP_NAME:"钟山区永和烟酒店",SHOP_ID:"17247",ADDRESS:"贵州省六盘水市钟山区",LATITUDE:"26.58441",LONGITUDE:"104.85483",IS_EXP:"1"},
                    {CUST_CODE:"520201104415",CUST_NAME:"严远建",SHORT_NAME:"钟山",SHOP_NAME:"严远建",SHOP_ID:"12903",ADDRESS:"贵州省六盘水市钟山区钟山开发区吉祥二街",LATITUDE:"26.58132",LONGITUDE:"104.86248",IS_EXP:"1"},
                    {CUST_CODE:"520201104850",CUST_NAME:"刘燕",SHORT_NAME:"钟山",SHOP_NAME:"刘燕",SHOP_ID:"9046",ADDRESS:"贵州省六盘水市钟山区荷泉街道人民中路",LATITUDE:"26.58623",LONGITUDE:"104.86177",IS_EXP:"1"},
                    {CUST_CODE:"520201101973",CUST_NAME:"李金合",SHORT_NAME:"钟山",SHOP_NAME:"李金合",SHOP_ID:"9474",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.57811",LONGITUDE:"104.86121",IS_EXP:"1"},
                    {CUST_CODE:"520201107120",CUST_NAME:"勇勇副食店",SHORT_NAME:"钟山",SHOP_NAME:"贵州省六盘水市钟山区马鞍山社区皇冠幼儿园对面",SHOP_ID:"17536",ADDRESS:"北京市东城区东华门街道缎库胡同52号缎库胡同15号院",LATITUDE:"26.58268",LONGITUDE:"104.85625",IS_EXP:"1"},
                    {CUST_CODE:"520201102202",CUST_NAME:"李焕鹏",SHORT_NAME:"钟山",SHOP_NAME:"李焕鹏",SHOP_ID:"17431",ADDRESS:"贵州省六盘水市钟山区名都商业广场1楼1号",LATITUDE:"26.58324",LONGITUDE:"104.86217",IS_EXP:"1"},
                    {CUST_CODE:"520201105661",CUST_NAME:"好运来烟酒副食店",SHORT_NAME:"钟山",SHOP_NAME:"好运来烟酒副食店",SHOP_ID:"12687",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.5661",LONGITUDE:"104.87765",IS_EXP:"1"},
                    {CUST_CODE:"520201106806",CUST_NAME:"钟山区万盛超市",SHORT_NAME:"钟山",SHOP_NAME:"钟山区万盛超市",SHOP_ID:"9943",ADDRESS:"贵州省六盘水市钟山区麒麟大道闽南商贸城一楼C区",LATITUDE:"26.58373",LONGITUDE:"104.86174",IS_EXP:"1"},
                    {CUST_CODE:"520201102159",CUST_NAME:"随意烟酒自选店",SHORT_NAME:"钟山",SHOP_NAME:"吴勇",SHOP_ID:"15692",ADDRESS:"贵州省六盘水市钟山区荷泉路189号附近",LATITUDE:"26.58307",LONGITUDE:"104.86904",IS_EXP:"1"},
                    {CUST_CODE:"520201102207",CUST_NAME:"朱艳",SHORT_NAME:"钟山",SHOP_NAME:"朱艳的小店",SHOP_ID:"13106",ADDRESS:"贵州省六盘水市钟山区荷城街道凤凰路",LATITUDE:"26.57999",LONGITUDE:"104.8707",IS_EXP:"3"},
                    {CUST_CODE:"520201104550",CUST_NAME:"十万人家购物中心",SHORT_NAME:"钟山",SHOP_NAME:"十万人家购物中心",SHOP_ID:"9858",ADDRESS:"贵州省六盘水市钟山区钟山区",LATITUDE:"26.63284",LONGITUDE:"104.84384",IS_EXP:"1"},
                    {CUST_CODE:"520201100856",CUST_NAME:"贵客隆商店",SHORT_NAME:"钟山",SHOP_NAME:"贵客隆商店",SHOP_ID:"19712",ADDRESS:"贵州省六盘水市钟山区建设西路1号附近",LATITUDE:"26.59776",LONGITUDE:"104.82826",IS_EXP:"1"}
                ];

//{"message":"获取失败","success":true,"code":"404","data":{"carLastLocation":[{"LICENSE_ID":13,"STATE":"1","PATH_ID":"LPS1403","RN":1,"OPERATOR_TIME":1524647337000,"LATITUDE":26.19873,"PLATE_NUMBER":"贵BF5019","COURIER_ID":19320,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2706,"DRIVER_ID":19896,"LONGITUDE":105.48148,"DELIVER_LINE_NAME":"城网6线"},{"LICENSE_ID":9,"STATE":"1","PATH_ID":"LPS2215","RN":1,"OPERATOR_TIME":1524647600000,"LATITUDE":26.5869,"PLATE_NUMBER":"贵B56871","COURIER_ID":19381,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2712,"DRIVER_ID":19835,"LONGITUDE":104.83027,"DELIVER_LINE_NAME":"明湖二段窑上"},{"LICENSE_ID":16,"STATE":"1","PATH_ID":"LPS72604","RN":1,"OPERATOR_TIME":1524647189000,"LATITUDE":26.57486,"PLATE_NUMBER":"贵BHV327","COURIER_ID":19423,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2704,"DRIVER_ID":19424,"LONGITUDE":104.88353,"DELIVER_LINE_NAME":"荷城花园"},{"LICENSE_ID":8,"STATE":"1","PATH_ID":"LPS2407","RN":1,"OPERATOR_TIME":1524647521000,"LATITUDE":26.6118,"PLATE_NUMBER":"贵BN3418","COURIER_ID":19431,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2710,"DRIVER_ID":19846,"LONGITUDE":104.8005,"DELIVER_LINE_NAME":"德坞梅花山"},{"LICENSE_ID":7,"STATE":"1","PATH_ID":"LPS2206","RN":1,"OPERATOR_TIME":1524647130000,"LATITUDE":26.3747,"PLATE_NUMBER":"贵BN3400","COURIER_ID":19453,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2702,"DRIVER_ID":19385,"LONGITUDE":105.20546,"DELIVER_LINE_NAME":"红岩"},{"LICENSE_ID":1,"STATE":"1","PATH_ID":"LPS2309","RN":1,"OPERATOR_TIME":1524647433000,"LATITUDE":26.70096,"PLATE_NUMBER":"贵BD4985","COURIER_ID":19456,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2708,"DRIVER_ID":19855,"LONGITUDE":104.80532,"DELIVER_LINE_NAME":"红旗矿西山"},{"LICENSE_ID":40,"STATE":"1","PATH_ID":"LPS1405","RN":1,"OPERATOR_TIME":1524647564000,"LATITUDE":26.6433,"PLATE_NUMBER":"贵BNB675","COURIER_ID":19473,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2711,"DRIVER_ID":20723,"LONGITUDE":104.83171,"DELIVER_LINE_NAME":"郎岱2"},{"LICENSE_ID":41,"STATE":"1","PATH_ID":"LPS2304","RN":1,"OPERATOR_TIME":1524647397000,"LATITUDE":26.72495,"PLATE_NUMBER":"贵BNW192","COURIER_ID":19482,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2707,"DRIVER_ID":19397,"LONGITUDE":104.9901,"DELIVER_LINE_NAME":"南开金盆"},{"LICENSE_ID":18,"STATE":"1","PATH_ID":"LPS121507","RN":1,"OPERATOR_TIME":1524647162000,"LATITUDE":26.22055,"PLATE_NUMBER":"贵BHV372","COURIER_ID":19496,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2703,"DRIVER_ID":19852,"LONGITUDE":105.46747,"DELIVER_LINE_NAME":"城网3线"},{"LICENSE_ID":17,"STATE":"1","PATH_ID":"LPS1406","RN":1,"OPERATOR_TIME":1524647300000,"LATITUDE":26.58505,"PLATE_NUMBER":"贵BHV367","COURIER_ID":19505,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2705,"DRIVER_ID":19815,"LONGITUDE":104.83652,"DELIVER_LINE_NAME":"郎岱1"},{"LICENSE_ID":10,"STATE":"1","PATH_ID":"LPS1407","RN":1,"OPERATOR_TIME":1524647492000,"LATITUDE":26.15646,"PLATE_NUMBER":"贵B56893","COURIER_ID":19709,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2709,"DRIVER_ID":19861,"LONGITUDE":105.19021,"DELIVER_LINE_NAME":"中寨"},{"LICENSE_ID":6,"STATE":"1","PATH_ID":"LPS1402","RN":1,"OPERATOR_TIME":1524647651000,"LATITUDE":26.54454,"PLATE_NUMBER":"贵BD5396","COURIER_ID":19849,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2714,"DRIVER_ID":20722,"LONGITUDE":104.88581,"DELIVER_LINE_NAME":"新窑"},{"LICENSE_ID":15,"STATE":"1","PATH_ID":"LPS1404","RN":1,"OPERATOR_TIME":1524647089000,"LATITUDE":26.23121,"PLATE_NUMBER":"贵BHV317","COURIER_ID":19853,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2701,"DRIVER_ID":19850,"LONGITUDE":105.37053,"DELIVER_LINE_NAME":"凉水井"},{"LICENSE_ID":19,"STATE":"1","PATH_ID":"LPS101505","RN":1,"OPERATOR_TIME":1524647626000,"LATITUDE":26.19482,"PLATE_NUMBER":"贵BJD836","COURIER_ID":19856,"CHANNEL":"本部","DELIVERY_TIME":"2018-04-26","ID":2713,"DRIVER_ID":20155,"LONGITUDE":105.48243,"DELIVER_LINE_NAME":"城网1线"},{"LICENSE_ID":42,"STATE":"1","PATH_ID":"LPS209","RN":1,"OPERATOR_TIME":1524703122000,"LATITUDE":25.78977,"PLATE_NUMBER":"贵BRM953","COURIER_ID":20272,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2718,"DRIVER_ID":20340,"LONGITUDE":104.66178,"DELIVER_LINE_NAME":"盘县三十一线"},{"LICENSE_ID":21,"ASSIST_COURIER_ID":20330,"STATE":"1","PATH_ID":"LPS208","RN":1,"OPERATOR_TIME":1524703228000,"LATITUDE":25.79442,"PLATE_NUMBER":"贵BHS593","COURIER_ID":20274,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2721,"DRIVER_ID":20273,"LONGITUDE":104.54162,"DELIVER_LINE_NAME":"盘县三十线"},{"LICENSE_ID":45,"ASSIST_COURIER_ID":20278,"STATE":"1","PATH_ID":"LPS203","RN":1,"OPERATOR_TIME":1524702993000,"LATITUDE":25.90518,"PLATE_NUMBER":"贵BLO938","COURIER_ID":20279,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2715,"DRIVER_ID":20336,"LONGITUDE":104.89404,"DELIVER_LINE_NAME":"盘县二十五线"},{"LICENSE_ID":30,"ASSIST_COURIER_ID":20324,"STATE":"1","PATH_ID":"LPS210","RN":1,"OPERATOR_TIME":1524703251000,"LATITUDE":25.79266,"PLATE_NUMBER":"贵B56890","COURIER_ID":20283,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2722,"DRIVER_ID":20281,"LONGITUDE":104.85899,"DELIVER_LINE_NAME":"盘县三十二线"},{"LICENSE_ID":31,"ASSIST_COURIER_ID":20285,"STATE":"1","PATH_ID":"LPS214","RN":1,"OPERATOR_TIME":1524703276000,"LATITUDE":25.785,"PLATE_NUMBER":"贵B56823","COURIER_ID":20284,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2723,"DRIVER_ID":20275,"LONGITUDE":104.6597,"DELIVER_LINE_NAME":"盘县三十六线"},{"LICENSE_ID":44,"ASSIST_COURIER_ID":20341,"STATE":"1","PATH_ID":"LPS205","RN":1,"OPERATOR_TIME":1524703091000,"LATITUDE":25.67371,"PLATE_NUMBER":"贵BPW569","COURIER_ID":20286,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2717,"DRIVER_ID":20339,"LONGITUDE":104.60708,"DELIVER_LINE_NAME":"盘县二十七线"},{"LICENSE_ID":24,"ASSIST_COURIER_ID":20276,"STATE":"1","PATH_ID":"LPS204","RN":1,"OPERATOR_TIME":1524703039000,"LATITUDE":25.7322,"PLATE_NUMBER":"贵BHS572","COURIER_ID":20326,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2716,"DRIVER_ID":20337,"LONGITUDE":104.64102,"DELIVER_LINE_NAME":"盘县二十六线"},{"LICENSE_ID":20,"ASSIST_COURIER_ID":22537,"STATE":"1","PATH_ID":"LPS206","RN":1,"OPERATOR_TIME":1524703161000,"LATITUDE":25.8118,"PLATE_NUMBER":"贵BHS562","COURIER_ID":20327,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2719,"DRIVER_ID":20335,"LONGITUDE":104.68507,"DELIVER_LINE_NAME":"盘县二十八线"},{"LICENSE_ID":23,"ASSIST_COURIER_ID":20338,"STATE":"1","PATH_ID":"LPS207","RN":1,"OPERATOR_TIME":1524703205000,"LATITUDE":25.7846,"PLATE_NUMBER":"贵BHS549","COURIER_ID":20333,"CHANNEL":"盘县","DELIVERY_TIME":"2018-04-26","ID":2720,"DRIVER_ID":20271,"LONGITUDE":104.61001,"DELIVER_LINE_NAME":"盘县二十九线"}],"todayNums":{"CUSTOMER":"0","PATH":"23","CAR":"23","FCUSTOMER":"0"},"yearData":[{"CUSTOMER":12755,"AMT":64449977.03,"DELIVER_DATE":"201710","QUANTITY":535435},{"CUSTOMER":55300,"AMT":234569490.12,"DELIVER_DATE":"201711","QUANTITY":2015226},{"CUSTOMER":28758,"AMT":112632876.48,"DELIVER_DATE":"201712","QUANTITY":891905},{"CUSTOMER":74280,"AMT":691290851.67,"DELIVER_DATE":"201801","QUANTITY":5160673},{"CUSTOMER":48514,"AMT":385103761.07,"DELIVER_DATE":"201802","QUANTITY":2861119},{"CUSTOMER":55294,"AMT":274326297.54,"DELIVER_DATE":"201803","QUANTITY":2120662},{"CUSTOMER":45158,"AMT":220401088.4,"DELIVER_DATE":"201804","QUANTITY":1811275}]}}
                map.remove(this.markerList);
                map.clearInfoWindow();
                this.markerList = [];
                if (!dataArray || dataArray.length ==0) {
                    return;
                }
                map.setCenter(new AMap.LngLat(dataArray[0].LONGITUDE,dataArray[0].LATITUDE));
                var markerList=[];
                for (var index in dataArray) {
                    var markeInfo = dataArray[index];
                    var image = '${contextPath}/static/image/marker.png';//24px*24px
                    if (markeInfo.IS_EXP == '1') {
                        image = '${contextPath}/static/image/exp.png';
                    }
                    var icon = new AMap.Icon({
                        image : image,//24px*24px
                        //icon可缺省，缺省时为默认的蓝色水滴图标，
                        size : new AMap.Size(50,38)
                    });
                    var marker = new AMap.Marker({
                        icon : icon,//24px*24px
                        position : [markeInfo.LONGITUDE,markeInfo.LATITUDE],
                        title:markeInfo.CUST_CODE,
                        offset : new AMap.Pixel(-12,-12),
                        //animation:'AMAP_ANIMATION_BOUNCE',
                        map : map
                    });
                    marker.content = '客户名称：'+ (markeInfo.CUST_NAME ? markeInfo.CUST_NAME : '')  +
                        '<br>客户号：'+ markeInfo.CUST_CODE +
                        '<br>店铺名称：'+ markeInfo.SHOP_NAME+
                        '<br>店铺Id：'+ markeInfo.SHOP_ID +
                        '<br>是否试点：'+ (markeInfo.IS_EXP == '1' ? '是':'否') +
                        '<br>店铺地址：'+ markeInfo.ADDRESS
                    ;

                    AMap.event.addListener(marker, 'click', function(e) {
                        infoWindow.setContent(e.target.content);
                        infoWindow.open(map, e.target.getPosition());
                    });
                    markerList.push(marker);
                }
                this.markerList = markerList;

            }
        }
    });
</script>
</body>
</html>